package com.servlet.book;

import com.service.book.BookServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.TimerTask;

/**
 * 创建作者 ：MySunshine
 * 创建时间 2022/10/28 10:44
 * 项目名称 SHUSHAN
 */
@WebServlet("/BookDeleteById")
public class BookDeleteById extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        BookServiceImpl bsi = new BookServiceImpl();
        boolean b = bsi.DeleteBookById(Integer.parseInt(id));
        if (b){
            System.out.println("删除成功");
            resp.sendRedirect("/page/dba/dbaBookMge.jsp");
    }else {
            System.out.println("删除失败！");
        }
    }
}
